package CSDN顺序存储;

public class Test_Sqlist {
    public static void main(String[] args) throws Exception {
        SqList sqList=new SqList();
        sqList.add("零号");
        sqList.add("一号");
        sqList.add("二号");
        sqList.add("三号");
        sqList.add("四号");
        sqList.add("五号");
        sqList.add("六号");
        System.out.println("顺序表是否为空："+sqList.isEmpty()+"   顺序表长度为"+sqList.getLength());
        sqList.display();
        System.out.println("第四个数据元素为："+sqList.getElement(4)+"  表中”四号“的前驱为：" +sqList.priorElem("四号")+
                "   表中”四号“的后继为："+sqList.nextElem("四号")+"  表中”四号“的下标为："+sqList.getLocate("四号"));
        System.out.println("-------插入“你好”到第4个位置---------");
        sqList.listInsert(4,"你好");
        sqList.display();
        System.out.println("-------删除第四个位置的数据---------");
        sqList.listDelete(4);
        sqList.display();
        System.out.println("-------将顺序表置空并销毁---------");
        sqList.clear();
        sqList.destroy();
    }
}